import request from '@/utils/request'


/**
 * 会员列表
 */
export function getMembers() {
    return request({
      url: '/member/list',
      method: 'get',
      params: {}
    })
}

/**
 * 会员详情
 */
export function getMemberDetail(id) {
    return request({
      url: `/member/getItem/${id}`,
      method: 'get'
    })
}

/**
 * 启禁用会员
 */
export function updateMemberStatus(id,status) {
    return request({
      url: `/member/updateStatus/${id}`,
      method: 'post',
      params: { status:status}
    })
}


/**
 * 会员等级列表
 */
export function getMemberLevels() {
    return request({
      url: '/memberLevel/list',
      method: 'get'
    })
}

/**
 * 新增会员等级
 */
export function addMemberLevel(data) {
    return request({
      url: '/memberLevel/create',
      method: 'post',
      data
    })
}

/**
 * 根据id获取会员等级详情
 */
export function getMemberLevelDetal(id) {
    return request({
      url: `/memberLevel/detail/${id}`,
      method: 'get'
    })
}

/**
 * 更新会员等级
 */
export function updateMemberLevel(data) {
    return request({
      url: `/memberLevel/upload/${data.id}`,
      method: 'post',
      data
    })
}

/**
 * 删除会员等级
 */
export function delMemberLevel(id) {
    return request({
        url: `/memberLevel/delete/${id}`,
        method: 'post'
    })
}

